/*************************Line.h***********************
 * this file is the header file for Lines
 * author: Zebras Wen
 * date: 2012.11.04
 * version: 0.01
 * history:
 * copyLeft:
 *   all rights are under the GPL v3.0
 *********************************************************/

#ifndef _LINE_
#define _LINE_

#include<list>
#include<iostream>
#include<string>

using namespace std;

class Station;
// class string;

class Line
{
public:
    Line(void);
    ~Line(void);

    // copy constructor and assignment
    Line(const Line&);
    Line& operator=(const Line&);

    // edit stations

    Station* findStation(Station*);
    Station* findStation(const string&);
    void addStationEnd(Station*);
    void addStationBegin(Station*);
    void addStationBefore(Station*, Station *beforeStation);
    void addStationAfter(Station*, Station *afterStation);
    void addStationBefore(Station*, const string& beforeStation);
    void addStationAfter(Station*, const string& afterStation);

    void delStations(Station*);
    void delStations(const string&);


    // edit line number
    inline void setLineNo(int lineNo)
    {
        lineNo_ = lineNo;
    }
    inline int getLineNo()
    {
        return lineNo_;
    }

    // print stations
    // operator overloading
    friend ostream& operator<<(ostream&, Line&);
    void printLine(ostream&);

private:
    list<Station*> line_;
    int lineNo_;
};
#endif // _LINE_
